package cn.usian.service.Impl;

import cn.usian.mapper.EmpMapper;
import cn.usian.pojo.Emp;
import cn.usian.service.EmpService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class EmpServiceImpl implements EmpService {
    @Resource
    private EmpMapper empMapper;

    @Override
    public List<Emp> findAll() {
        return empMapper.selectList(null);
    }

    @Override
    public void add(Emp emp) {
        empMapper.insert(emp);
    }

    @Override
    public void del(int id) {
        empMapper.deleteById(id);
    }

    @Override
    public Emp findByid(int id) {
        return empMapper.selectById(id);
    }

    @Override
    public void update(Emp emp) {
        empMapper.updateById(emp);
    }
}
